﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace BibleService
{
	/// <summary>
	/// Bible服务
	/// </summary>
	[WebService(Namespace = "http://bibleServer.ireaderServer.com/")]
	[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
	[System.ComponentModel.ToolboxItem(false)]
	public class BibleService : System.Web.Services.WebService
	{		
		[WebMethod(Description="获取所有书本列表")]
		public List<Lib.Book> Book_GetAllBookList()
		{
			/*
			 *<books>
			 *	<book name="书本名称" enname="英文名称" />
			 *</books>
			 */
			return Lib.Book.GetAllBookList();
		}
		[WebMethod(Description="获取旧约列表")]
		public List<Lib.Book> Book_GetOldTestamentList()
		{
			/*
			 * 
			 */
			return Lib.Book.GetOldTestamentList();
		}
		[WebMethod(Description = "获取新约列表")]
		public List<Lib.Book> Book_GetNewTestamentList()
		{
			/*
			 * 
			 */
			return Lib.Book.GetNewTestamentList();
		}
		[WebMethod(Description="获取指定书本的章列表")]
		public List<Lib.Chapter> Chapter_GetChapterList(int bookId)
		{
			/*
			 *
			 */
			return Lib.Chapter.GetChapterList(bookId);
		}
		[WebMethod(Description="获取指定书指定章的内容列表")]
		public List<Lib.Paragraph> Paragraph_GetParagraphList(int bookId, int chapterNumber)		
		{
			/*
			 * 
			 */
			return Lib.Paragraph.GetParagraphList(bookId, chapterNumber);
		}
		[WebMethod(Description = "搜索书本")]
		public List<Lib.Paragraph> Paragraph_GetParagraphListBySearch(string keywords, string range)
		{
			/*			 
			 *<searchResult>
			 *	<li>搜索项</li>
			 *</searchResult>
			 */
			return Lib.Paragraph.GetParagraphListBySearch(keywords,range);
		}
		[WebMethod(Description = "获取注释内容")]
		public Lib.Commentary Commentary_GetCommentary(int bookId, int chapterNumber)
		{
			/*
			 *<book>
			 *	<title>标题</title>
			 *	<content>内容</content>
			 *	<commentary>注释内容</commentary>
			 *</book>
			 */
			var commentary=Lib.Commentary.GetCommentary(bookId,chapterNumber);
			return commentary;
		}
		
	}
}
